package com.project.mapper;

import com.project.bean.EmployeeBean;
import com.project.bean.ProcessBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;

public interface IProcessMapper {
    @Mapper
    /**
     * 员工完成项目，将指定进度ID对应的记录，完成时间修改当前时间
     * @param processId 进度id
     */
    @Update("update t_em_ma set ma_endTime=#{date} where fk_mangerId=#{id}")
    public  void finishProject(@Param("id") int processId, @Param("date") LocalDate date);

    /**
     * 添加员工参与项目的进度信息
     * @param processBean 进度对象
     */
    @Insert("INSERT INTO t_em_ma(fk_emId,fk_mangerId,ma_startTime,ma_endTime)VALUES(#{emBean.emId},#{project.managerId},#{startDate},#{endDate})")
    public  void addEP(ProcessBean processBean);


}
